{*include file='share/head.html'*}
<link rel="stylesheet" type="text/css" href="static/pubilc/bootstrap/css/bootstrap-select.min.css"/>

{*include file='index/header.html'*}
<script src="static/pubilc/bootstrap/js/jquery.min.js"></script>
<script src="static/pubilc/bootstrap/js/bootstrap.min.js"></script>
<script src="static/pubilc/bootstrap/js/bootstrap-select.js"></script>
<script src="static/js/jedate.min.js"></script>

<div class="IC-card">
	<div class="container">
		<div class="IC-content">
		    <span class="title-content">新增车辆</span>
		    <form class="bs-example bs-example-form" method="post" action="index.php?c=index&m=addcar" id="carForm">
		        <input type="text" id="car_id" name="carid" value="{*$data.id*}" style="display:none">
		        <div class="form-inline">
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">车辆牌号:</span>
		                    <div class="input-group-btn">
		                        <select class="selectpicker input-group-btn" name="vehicleCodePrefix">
								  {*foreach $carconf.vehicleCodePrefix as $value*}
								   <option value="{*$value*}" 
								   	{*if $value==$data.vehicleCodePrefix*}select{*/if*}>
								   		{*$value*}</option>
								  {*/foreach*}
								</select>
		                    </div>
		                    <input id="car_code" name="car_code" type="text" class="form-control" value="{*$data.car_code*}" placeholder="A6666">
		                </div>
		            </div>
		
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">车牌颜色:</span>
		                    <select class="selectpicker select2" name="vehicleCardColor">
							  {*foreach $carconf.vehicleCardColor as $value*}
							   <option value="{*$value*}" 
							   	{*if $value==$data.vehicleCardColor*}select{*/if*}>
							   		{*$value*}</option>
							  {*/foreach*}
							</select>
		                </div>
		            </div>
		
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">车辆类别:</span>
		                    <select class="selectpicker select2" name="vehicleProperty">
							  {*foreach $carconf.vehicleProperty as $value*}
							   <option value="{*$value*}"
							   	{*if $value==$data.vehicleProperty*}select{*/if*}>
							   		{*$value*}</option>
							  {*/foreach*}
							</select>
		                    <!--<span class="input-group-addon">.00</span>-->
		                </div>
		            </div>
		        </div>
		        <div class="form-inline">
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">车辆类型:</span>
		                    <select class="selectpicker select2" name="vehicleType">
							  {*foreach $carconf.vehicleType as $value*}
							   <option value="{*$value*}"
							   	{*if $value==$data.vehicleType*}select{*/if*}>
							   		{*$value*}</option>
							  {*/foreach*}
							</select>
		                </div>
		            </div>
		
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">车身颜色:</span>
		                   <select class="selectpicker select2" name="vehicleBodyColor">
							  {*foreach $carconf.vehicleBodyColor as $value*}
							   <option value="{*$value*}"
							   	{*if $value==$data.vehicleBodyColor*}select{*/if*}>
							   		{*$value*}</option>
							  {*/foreach*}
							</select>
		                </div>
		            </div>
		
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">技术等级:</span>
		                    <select class="selectpicker select2" name="vehicleDegreeType">
							  {*foreach $carconf.vehicleDegreeType as $value*}
							   <option value="{*$value*}"
							   	{*if $value==$data.vehicleDegreeType*}select{*/if*}>
							   		{*$value*}</option>
							  {*/foreach*}
							</select>
		                </div>
		            </div>
		        </div>
		        <div class="form-inline">
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">车辆等级:</span>
		                    <select class="selectpicker select2" name="vehicleGrade">
							  {*foreach $carconf.vehicleGrade as $value*}
							   <option value="{*$value*}"
							   	{*if $value==$data.vehicleGrade*}select{*/if*}>
							   		{*$value*}</option>
							  {*/foreach*}
							</select>
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">燃油类别:</span>
		                    <select class="selectpicker select2" name="vehicleOilType">
							  {*foreach $carconf.vehicleOilType as $value*}
							   <option value="{*$value*}"
							   	{*if $value==$data.vehicleOilType*}select{*/if*}>
							   		{*$value*}</option>
							  {*/foreach*}
							</select>
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">厂牌型号:</span>
		                    <input name="vehicleModel" id="vehicleModel" type="text" class="form-control" value="{*$data.vehicleModel*}" placeholder="选择厂牌型号"/>
		                    <div class="input-group-btn">
		                        <span type="text" class="btn btn-eee" data-toggle="modal" data-target=".bs-brand-modal-lg"> 选择</span>
		                    </div>    
		                      
		                </div>
		            </div>
		        </div>
		        <div class="form-inline">
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">长（毫米）:</span>
		                    <input name="car_length" id="car_length" type="text" class="form-control"
		                    	value="{*$data.car_length*}" placeholder="6620">
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">宽（毫米）:</span>
		                    <input name="car_width" id="car_width" type="text" class="form-control"
		                    	value="{*$data.car_width*}" placeholder="2400">
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">高（毫米）:</span>
		                    <input id="car_height" name="car_height" type="text" class="form-control"
		                    	value="{*$data.car_height*}" placeholder="2600">
		                </div>
		            </div>
		        </div>
		        <div class="form-inline">
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">总座位:</span>
		                    <input name="total_seat" id="total_seat" type="text" class="form-control"
		                    	value="{*$data.total_seat*}" placeholder="0">
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">核定座位:</span>
		                    <input name="checked_seat" type="text" class="form-control"
		                    	value="{*$data.checked_seat*}" placeholder="0">
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">总吨位:</span>
		                    <input id="total_ton" name="total_ton" type="text" class="form-control"
		                    	value="{*$data.total_ton*}" placeholder="0.99">
		                </div>
		            </div>
		        </div>
		        <div class="form-inline">
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">核定吨位:</span>
		                    <input name="checked_ton" type="text" class="form-control"
		                    	value="{*$data.checked_ton*}" placeholder="1.00">
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">行驶证注册日期:</span>
		                    <input class="form-control form-control-inline input-medium default-date-picker"
		                           type="text" id="driving_license_date" name="driving_license_date"
		                           value="{*$data.driving_license_date*}" placeholder="1990-01-01" readonly/>
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">发动机号:</span>
		                    <input name="engine_code" type="text" class="form-control"
		                    	value="{*$data.engine_code*}" placeholder="E05W1700527">
		                </div>
		            </div>
		        </div>
		        <div class="form-inline">
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">车架号:</span>
		                    <input name="car_shelf_code" type="text" class="form-control"
		                          value="{*$data.car_shelf_code*}">
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">批准文号:</span>
		                    <input name="approval_number" type="text" class="form-control"
		                           value="{*$data.approval_number*}">
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">运营产值:</span>
		                    <input name="operation_value" type="text" class="form-control" placeholder="743"
		                          value="{*$data.operation_valuegth*}">
		                </div>
		            </div>
		        </div>
		        <div class="form-inline">
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">运营性质:</span>
		                    <select class="selectpicker select2" name="operation_property">
							  <option value="运营" {*if $data.tachographs_install=='运营'*}select{*/if*}>运营</option>
							  <option value="非运营" {*if $data.tachographs_install=='非运营'*}select{*/if*}>非运营</option>
							</select>
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">VIN码:</span>
		                    <input name="vin_code" type="text" class="form-control" placeholder="LJVA84D877W15469"
		                          value="{*$data.vin_code*}">
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">北斗安装:</span>
		                   <select class="selectpicker select2" name="dipper_install">
							  <option value="是" {*if $data.tachographs_install=='是'*}select{*/if*}>是</option>
							  <option value="否" {*if $data.tachographs_install=='否'*}select{*/if*}>否</option>
							</select>
		                </div>
		            </div>
		        </div>
		        <div class="form-inline">
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">行驶仪安装:</span>
		                    <select class="selectpicker select2" name="tachographs_install">
							  <option value="是" {*if $data.tachographs_install=='是'*}select{*/if*}>是</option>
							  <option value="否" {*if $data.tachographs_install=='否'*}select{*/if*}>否</option>
							</select>
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">尾气排放标准:</span>
		                    <select class="selectpicker select2" name="vehicleDischarge">
							  {*foreach $carconf.vehicleDischarge as $value*}
							   <option value="{*$value*}" {*if $value==$data.vehicleDischarge*}select{*/if*}>
							   		{*$value*}</option>
							  {*/foreach*}
							</select>
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">购车发票号:</span>
		                    <input name="purchase_invoice" type="text" class="form-control"
		                           value="{*$data.purchase_invoice*}">
		                </div>
		            </div>
		        </div>
		        <div class="form-inline">
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">购车日期:</span>
		                    <input class="form-control form-control-inline input-medium default-date-picker"
		                           type="text" id="purchase_date" name="purchase_date" value="{*$data.purchase_date*}" placeholder="1990-01-01"
		                           readonly />
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon">出厂日期:</span>
		                    <input class="form-control form-control-inline input-medium default-date-picker"
		                           type="text" id="production_date" name="production_date" value="{*$data.production_date*}" placeholder="1990-01-01"
		                           readonly/>
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon title-add">强制报废日期:</span>
		                    <input class="form-control form-control-inline input-medium default-date-picker"
		                           type="text" id="out_date" name="out_date" value="{*$data.out_date*}" placeholder="1990-01-01"
		                          readonly/>
		                </div>
		            </div>
		        </div>
		        <div class="form-inline">
		            <div class="col-xs-8 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon title-add">生产厂家:</span>
		                    <input name="car_manufacturer" type="text" class="form-control"
		                           value="{*$data.car_manufacturer*}">
		                </div>
		            </div>
		            <div class="col-xs-4 form-inline-item">
		                <div class="input-group col-xs-12">
		                    <span class="input-group-addon ">报停天数:</span>
		                    <input name="stop_days" type="text" class="form-control" placeholder="15"
		                          value="{*$data.stop_days*}" >
		                </div>
		            </div>
		        </div>
		        <div class="form-inline">
		            <div class="col-xs-3 form-inline-item pull-right">
		                <!--<a href="index.php?c=index&m=addattach" class="col-xs-12 btn btn-success">下一步</a>-->
		                <button type="submit" class="col-xs-12 btn btn-success">下一步</button>
		            </div>
		        </div>
		    </form>
		</div>
		<div class="modal fade bs-brand-modal-lg container" id="brand-model">
		    <div class="modal-dialog modal-lg">
		        <div class="modal-content">
		            <div class="modal-header">
		                <button type="button" class="close" data-dismiss="modal"><span
		                        aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
		                <h4 class="modal-title">厂牌型号选择</h4>
		            </div>
		            <div class="modal-body">
		                <table class="table">
		                    <tr>
		                        <th>编号</th>
		                        <th>厂牌型号</th>
		                        <th>车长</th>
		                        <th>车宽</th>
		                        <th>车高</th>
		                        <th>燃料</th>
		                        <th>吨位</th>
		                        <th>座位</th>
		                    </tr>
		                    <tbody id="brand_table_data" style="cursor: pointer;">
		                    	{*foreach $carlabel as $value*}
		                    	<tr name="{*$value.id*}">
									<th>{*$value.id*}</th>
									<th>{*$value.vehicleModel*}</th>
									<th>{*$value.length*}</th>
									<th>{*$value.width*}</th>
									<th>{*$value.height*}</th>
									<th>{*$value.oilType*}</th>
									<th>{*$value.capacity*}</th>
									<th>{*$value.passenger*}</th>
								</tr>
 								{*/foreach*}
		                    </tbody>
		                </table>
		            </div>
		            <div class="modal-footer">
		                <div class="row">
		                    <div class="col-xs-6">
		                        <ul class="pagination" id="pageNav" style="margin: 0; float: left;">
		                        	{*if $pages.page!=1*}
									<li><a href="index.php?c=index&m=index&page=1">&laquo;</a></li>
									<li><a href="index.php?c=index&m=index&page={*$pages.page-1*}">&lt;</a></li>
									{*/if*}
									{*for $page=1 to $pages.count*}
									<li class="{*if $pages.page==$page*}active{*/if*}">
										<a href="index.php?c=index&m=index&page={*$page*}">{*$page*}</a></li>
									{*/for*}
									{*if $pages.page!=$pages.count||$pages.page>1*}
									<li><a href="index.php?c=index&m=index&page={*$pages.page+1*}">&gt;</a></li>
									<li><a href="index.php?c=index&m=index&page={*$pages.count*}">&raquo;</a></li>
									{*/if*}
		                        </ul>
		                    </div>
		                    <div class="col-xs-6 pull-right">
		                        <div class="input-group">
		                            <input type="text" class="form-control" placeholder="Search" id="search-brand-key">
		                            <div class="input-group-btn">
		                                <button type="button" id="search-brand" class="btn btn-default ">
		                                    查找
		                                </button>
		                                <button type="button" class="btn btn-primary" id="commit-brand">确定</button>
		                                <input type="text" value="2" hidden id="select-brand">
		                            </div>
		                        </div>
		                    </div>
		                </div>
		            </div>
		        </div><!-- /.modal-content -->
		    </div><!-- /.modal-dialog -->
		</div><!-- /.modal -->
		<!-- Small modal -->
		<div id="smg-model" class="modal fade bs-example-modal-sm container" tabindex="-1" role="dialog"
		     aria-labelledby="mySmallModalLabel" aria-hidden="true">
		    <div class="modal-dialog modal-sm">
		        <div class="modal-content">
		            <div class="modal-header">
		                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
		                        class="sr-only">Close</span></button>
		                <h4 class="modal-title">警告！</h4>
		            </div>
		            <div class="modal-body">
		            </div>
		            <div class="modal-footer">
		                <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
		            </div>
		        </div>
		    </div>
		</div>
   </div>
</div>

<script type="text/javascript">
	//       IE显示不错位
//  setTimeout(function(){
//  	$('.input-group-addon').css('width', '130px');
//  	$('.select2').css('width', '206px');
//	},1)
$(function(){
	$("#brand_table_data tr").click(function () {
        $("#brand_table_data tr").removeClass("info");
        $(this).addClass("info");
        $("#select-brand").val($(this).attr("name"));
    });
    
    $("#commit-brand").click(function () {
        var brandId = $("#select-brand").val();
        if (typeof(brandId) != "undefined" && brandId == 0) {
            alert("请选择厂牌型号");
            return false;
        }
		$("#vehicleModel").val($("#brand_table_data tr.info th").eq(1).text());
		$('#brand-model').modal('hide');
    });
})


	jeDate({
		dateCell:"#driving_license_date",
		format:"YYYY-MM-DD"
	})
	jeDate({
		dateCell:"#purchase_date",
		format:"YYYY-MM-DD"
	})
	jeDate({
		dateCell:"#production_date",
		format:"YYYY-MM-DD"
	})
	jeDate({
		dateCell:"#out_date",
		format:"YYYY-MM-DD"
	})
	
	
</script>
			
{*include file='share/footer.html'*}
